package com.mall.db.service;

import com.mall.db.dao.JobDao;
import com.mall.db.domain.JobAndTrigger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SchedulerService {

    @Autowired
    private JobDao jd;



    public List<JobAndTrigger> find(){
        return jd.find(new JobAndTrigger());
    }
   public JobAndTrigger getByJobName(String jobName){
        JobAndTrigger jt=new JobAndTrigger();
        jt.setJobName(jobName);
        List<JobAndTrigger>list=jd.find(jt);
        return list.size()>0?list.get(0):null;
   }
}
